<br>
<div class="row">
  <form class="form-inline text-left col-xs-12">
    <div class="form-group">
      <label>SourceType &nbsp;</label>
      <select class="form-control" ng-model="selectedSourceType">
        <option value="0">0 - CREATURE</option>
        <option value="1">1 - GAMEOBJECT</option>
        <option value="2">2 - AREATRIGGER</option>
        <option value="9">9 - TIMED_ACTIONLIST</option>
      </select>
    </div>
  </form>
</div>
<hr>
<div ng-show="selectedSourceType == 0">
  <p class="text-left lead">Search for Creatures</p>
  <div class="row">
    <form>
      <div class="form-group col-xs-2">
        <label class="control-label">Entry</label>
        <input class="form-control" type="text" placeholder="Creature Entry" ng-model="creature_template.entry">
      </div>
      <div class="form-group col-xs-3">
        <label class="control-label">Name</label>
        <input class="form-control" type="text" placeholder="Name" ng-model="creature_template.name">
      </div>
      <div class="form-group col-xs-3">
        <label class="control-label">Subname</label>
        <input class="form-control" type="text" placeholder="Subname" ng-model="creature_template.subname">
      </div>
      <div class="col-xs-1">
        <button type="submit" class="btn btn-primary" ng-click="searchCreatures(creature_template.entry, creature_template.name, creature_template.subname)" style="margin-top: 25px">Search</button>
      </div>
    </form>
  </div>
  <br>
  <p>Select the target of the new SmartAI script:</p>
  <table class="table table-striped table-condensed" ts-wrapper>
    <thead>
      <th class="text-center" ts-criteria="entry|parseInt">Entry</th>
      <th class="text-center" ts-criteria="name|lowercase">Name</th>
      <th class="text-center" ts-criteria="subname|lowercase">Subname</th>
    </thead>
    <tbody>
      <tr ng-repeat="creature in creatures" ts-repeat>
        <td><a ng-href="./#/sai/0/{{ creature.entry }}">{{ creature.entry }}</a></td>
        <td><a ng-href="./#/sai/0/{{ creature.entry }}">{{ creature.name }}</a></td>
        <td>{{ creature.subname }}</td>
      </tr>
    </tbody>
  </table>
</div>

<div ng-show="selectedSourceType == 1">
  <p class="text-left lead">Search for Gameobjects</p>
  <div class="row">
    <form>
      <div class="form-group col-xs-2">
        <label class="control-label">Entry</label>
        <input class="form-control" type="text" placeholder="Gameobject Entry" ng-model="gameobject_template.entry">
      </div>
      <div class="form-group col-xs-3">
        <label class="control-label">Name</label>
        <input class="form-control" type="text" placeholder="Name" ng-model="gameobject_template.name">
      </div>
      <div class="col-xs-1">
        <button type="submit" class="btn btn-primary" ng-click="searchGameObjects(gameobject_template.entry, gameobject_template.name)" style="margin-top: 25px">Search</button>
      </div>
    </form>
  </div>
  <br>
  <p>Select the target of the new SmartAI script:</p>
  <table class="table table-striped table-condensed" ts-wrapper>
    <thead>
      <th class="text-center" ts-criteria="entry|parseInt">Entry</th>
      <th class="text-center" ts-criteria="name|lowercase">Name</th>
    </thead>
    <tbody>
      <tr ng-repeat="gameobject in gameobjects" ts-repeat>
        <td><a ng-href="./#/sai/1/{{ gameobject.entry }}">{{ gameobject.entry }}</a></td>
        <td><a ng-href="./#/sai/1/{{ gameobject.entry }}">{{ gameobject.name }}</a></td>
      </tr>
    </tbody>
  </table>

</div>

<div ng-show="selectedSourceType == 2">
  <form class="form-inline text-left col-xs-12">
    <div class="form-group">
      <label>AreaTrigger: &nbsp;</label>
      <input class="form-control" type="text" placeholder="AreaTrigger ID" ng-model="areaTriggerId">
    </div>
    <div class="form-group">
      <a href="./#/sai/2/{{ areaTriggerId }}"><button class="btn btn-small btn-primary">Go</button></a>
    </div>
  </form>
</div>

<div ng-show="selectedSourceType == 9">
  <form class="form-inline text-left col-xs-12">
    <div class="form-group">
      <label>Timed Actionlist: &nbsp;</label>
      <input class="form-control" type="text" placeholder="Timed Actionlist ID" ng-model="timedActionListId">
    </div>
    <div class="form-group">
      <a href="./#/sai/9/{{ timedActionListId }}"><button class="btn btn-small btn-primary">Go</button></a>
    </div>
  </form>
</div>
